<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        /* body,html{ height: 100%; } */
        *{ margin: 0; padding: 0; }
        .fixedBg{ 
            height: 500px;
            background-image: url("./1.jpg"); 
            background-position: center center; 
             background-repeat: no-repeat; 
             background-attachment: fixed;
            background-size: cover;  
        }
        .fixedBg1{   
          
            min-height: 500px;
            background-image: url("./2.jpg"); 
            background-position: center center; 
            background-repeat: no-repeat; 
            background-attachment: fixed;
            background-size: cover; 
        }
        .fixedBg2{ 
            min-height: 500px;
            background-image: url("./3.jpg"); 
            background-position: center center; 
            background-repeat: no-repeat; 
            background-attachment: fixed;
            background-size: cover; 
        }
        .fixedBg3{ 
            min-height: 500px;
            background-image: url("./4.jpg"); 
            background-position: center center; 
            background-repeat: no-repeat; 
            background-attachment: fixed;
            background-size: cover; 
        }
        .testBefore,.testAfter{
            background: #333;
            width: 100%;
            height: 300px;
            text-align: center;
        }
        h1{
            color: #fff;
            font-size: 100px;
            line-height: 300px;
        }
    </style>
</head>
<body>
        <div class="testBefore"><h1>BEFORE</h1></div>
        <div class="fixedBg"></div>
        <div class="testAfter"><h1>AFTER</h1></div>
        <hr>
        <br>
        <hr>
        <div class="testBefore"><h1>BEFORE</h1></div>
        <div class="fixedBg1"></div>
        <div class="testAfter"><h1>AFTER</h1></div>      
        <hr>
        <br>
        <hr>
        <div class="testBefore"><h1>BEFORE</h1></div>
        <div class="fixedBg2"></div>
        <div class="testAfter"><h1>AFTER</h1></div>      
        <hr>
        <br>
        <hr>
        <div class="testBefore"><h1>BEFORE</h1></div>
        <div class="fixedBg3"></div>
        <div class="testAfter"><h1>AFTER</h1></div>      
        
   
</body>
</html>